package com.xhwl.data.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xhwl.common.dto.cent.sdata.PublicAreaDTO;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.common.pojo.cent.sdata.PublicArea;
import com.xhwl.common.query.cent.sdata.PublicAreaQuery;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: luyi
 * @Description: 公区
 * @Date: Create in 9:40 2021/4/14
 */
@RestController
public interface IPublicAreaService extends IService<PublicArea> {

    /**
     * 创建
     *
     * @param publicArea
     * @return
     */
    @RequestMapping(value = "/public-area-service/create", method = RequestMethod.POST)
    ResultJson create(@RequestPart PublicAreaDTO publicArea);

    /**
     * 更新
     *
     * @param publicArea
     * @return
     */
    @RequestMapping(value = "/public-area-service/update", method = RequestMethod.POST)
    ResultJson update(@RequestPart PublicAreaDTO publicArea);

    /**
     * 分页
     *
     * @param publicAreaQuery
     * @param page
     * @return
     */
    @RequestMapping(value = "/public-area-service/page", method = RequestMethod.POST)
    Page<PublicArea> page(@RequestPart PublicAreaQuery publicAreaQuery, @RequestPart Page page);

    /**
     * 列表
     *
     * @param publicAreaQuery
     * @return
     */
    @RequestMapping(value = "/public-area-service/list", method = RequestMethod.POST)
    List<PublicArea> list(@RequestPart PublicAreaQuery publicAreaQuery);

    /**
     * 删除
     *
     * @param id
     * @return
     */
    @RequestMapping(value = "/public-area-service/delete", method = RequestMethod.POST)
    ResultJson delete(Integer id);

    /**
     * 批量创建
     *
     * @param publicAreaDTOs
     * @return
     */
    @RequestMapping(value = "/public-area-service/batch-create", method = RequestMethod.POST)
    ResultJson batchCreate(@RequestPart("publicAreaDTOs") List<PublicAreaDTO> publicAreaDTOs);

	/**
	 * 批量创建
	 * @param publicAreaDTOS
	 * @return
	 */
	ResultJson batchCreateFaster(List<PublicAreaDTO> publicAreaDTOS);

    /**
     * 获取当前编码
     *
     * @return
     */
    String getCurrentCode();

    ResultJson refreshSort(PublicAreaQuery publicAreaQuery);
}
